package servlet.admin.passage;

import entity.MixPFO;
import entity.Passage;
import service.PassageService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet( name = "PassageDetailServlet")
public class PassageDetailServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PassageService service=new PassageService();
        Integer passageId=Integer.parseInt(request.getParameter("passageId"));

//        System.out.println(passageId);
        List<MixPFO> list=service.passageDetail(passageId);

        request.setAttribute("list",list);
        request.getServletContext().getRequestDispatcher("/admin/passageDetail.jsp").forward(request, response);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
